package be.nepherte.movmanager.client.services;

import java.util.List;

import be.nepherte.movmanager.domain.Movie;
import be.nepherte.movmanager.domain.UserInfo;
import be.nepherte.movmanager.server.MovieServiceImpl;

import com.google.gwt.user.client.rpc.AsyncCallback;

/**
 * <p>
 * This class is the asynchronous client side stub for movie related services.
 * The actual implementation exists on the server side in
 * {@link MovieServiceImpl}. Apart from a server side implementation, a regular
 * client side version, {@link MovieService} is required as well. The used
 * communication protocol is Google's implementation of rpc.
 * </p>
 * 
 * <p>
 * Copyright © 2010 Bart Verhoeven
 * </p>
 * 
 * <p>
 * This file is part of MovManager.
 * </p>
 * 
 * <p>
 * MovManager is free software: you can redistribute it and/or modify it under
 * the terms of the GNU General Public License as published by the Free Software
 * Foundation, either version 3 of the License, or (at your option) any later
 * version.
 * </p>
 * 
 * <p>
 * MovManager is distributed in the hope that it will be useful, but WITHOUT ANY
 * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
 * A PARTICULAR PURPOSE. See the GNU General Public License for more details.
 * </p>
 * 
 * <p>
 * You should have received a copy of the GNU General Public License along with
 * MovManager. If not, see http://www.gnu.org/licenses/.
 * </p>
 * 
 * @author Bart Verhoeven
 * @version 0.1
 */
public interface MovieServiceAsync {

	/**
	 * @param 	movie
	 *          the movie to be stored
	 * @param 	userInfo
	 *          information about the user this movie belongs to
	 * @param	callback
	 * 			the callback object that gets notified when result is ready
	 * @see		MovieService#storeMovie(Movie, String)
	 */
	public void storeMovie(Movie movie, UserInfo userInfo, AsyncCallback<Movie> callback);
	
	/**
	 * @param 	movie
	 *          the movie to be edited
	 * @param 	userInfo
	 *          information about the user this movie belongs to
	 * @param	callback
	 * 			the callback object that gets notified when result is ready
	 * @see		MovieService#editMovie(Movie, String)
	 */
	public void editMovie(Movie movie, UserInfo userInfo, AsyncCallback<Void> callback);

	/**
	 * @param 	userInfo
	 *          information about the user this movie belongs to
	 * @param	callback
	 * 			the callback object that gets notified when result is ready	
	 * @see 	MovieService#getMovies(String)
	 */
	public void getMovies(UserInfo userInfo, AsyncCallback<List<Movie>> callback);
}
